package com.javasm.mb_store_api_final.sys_control.usercontrol.sys_menu.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.javasm.mb_store_api_final.sys_control.usercontrol.sys_menu.entity.SysMenu;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.data.domain.Pageable;
import java.util.List;

/**
 * (SysMenu)表数据库访问层
 *
 * @author makejava
 * @since 2024-07-29 20:18:20
 */
public interface SysMenuDao extends BaseMapper<SysMenu> {

    @Select("select * from sys_menu where menu_type = 0")
    List<SysMenu> listMenuLevel1();

    @Select("select * from sys_menu where menu_type = 1")
    List<SysMenu> listMenuLevel2();

    @Select("SELECT * FROM sys_menu WHERE id in\n" +
            "(SELECT menu_id FROM menu_role WHERE role_id=#{rid})")
    List<SysMenu> listMenuByRid(Integer rid);
}

